import request from '@/utiles/request.js'
import store from '@/store'
// 发布房屋所需条件
export const houseParamsApi = () => {
  return request({
    url: '/houses/params',
    headers: { authorization: store.state.token }
  })
}
// 发布房源
export const rentalHouseApi = (data) => {
  return request({
    url: '/user/houses',
    headers: {
      authorization: store.state.token
    },
    method: 'POST',
    data
  })
}
// 房屋图像上传
export const houseImgApi = (data) => {
  return request({
    url: '/houses/image',
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'POST',
    data
  })
}
// 查看已发布的房源列表

export const userHouseApi = () => {
  return request({
    url: '/user/houses',
    headers: {
      authorization: store.state.token
    }
  })
}
